﻿using System;
using System.Collections.Generic;
using System.Text;
using NetworkLib.Utilities;

namespace PokemonBattle.BattleRoom.Client
{
    public class RoomBattleSetting : DataByteArray
    {
        public int MoveInterval { get; set; }
        public bool SingleBan { get; set; }
        public bool DoubleBan { get; set; }
        public bool FourPlayerBan { get; set; }
        public bool RandomOnly { get; set; }
        public string Version { get; set; }

        #region abstract

        public override void Read(ByteArray byteArray)
        {
            this.MoveInterval = byteArray.ReadInt();
            this.SingleBan = byteArray.ReadBoolean();
            this.DoubleBan = byteArray.ReadBoolean();
            this.FourPlayerBan = byteArray.ReadBoolean();
            this.RandomOnly = byteArray.ReadBoolean();
            this.Version = byteArray.ReadUTF();
        }

        public override void Write(ByteArray byteArray)
        {
            byteArray.WriteInt(this.MoveInterval);
            byteArray.WriteBoolean(this.SingleBan);
            byteArray.WriteBoolean(this.DoubleBan);
            byteArray.WriteBoolean(this.FourPlayerBan);
            byteArray.WriteBoolean(this.RandomOnly);
            byteArray.WriteUTF(this.Version);
        }

        #endregion

    }
}